package com.sbtr.open.classify.dto;

import java.io.Serializable;

/**
 * 	封装更新对象
 * @author ex_lifc
 *
 */
public class Item implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Long id;
	private int val;
	
	public Item() {
		super();
	}
	public Item(Long id, int val) {
		super();
		this.id = id;
		this.val = val;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public int getVal() {
		return val;
	}

	public void setVal(int val) {
		this.val = val;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + val;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Item) {
			Item item = (Item) obj;
			return item.getId() == this.id;
		}
		return false;
	}
	
}
